<?php
// Pull in the NuSOAP code
require_once('libs/nusoap.php');
// Create the client instance
$client = new soap_client('http://localhost/ynticket/api/soap/index.php?wsdl', true);
//echo "end point: ".$client->endpoint;
// Check for an error
$err = $client->getError();
if ($err) {
    // Display the error
    echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
    // At this point, you know the call that follows will fail
}
// Call the SOAP method
$args = array
                (
                    'username'        => "vinh.thaidac",
                    'password'        => "123abc",
                	'from_email'	=> 'kkk@gmail.com',
                	'to_email'		=> 'cnbktest@gmail.com'
                );
$result = $client->call('ostTicket.moveTickets', $args);
// Check for a fault
if ($client->fault) {
    echo '<h2>Fault</h2><pre>';
    print_r($result);
    echo '</pre>';
} else {
    // Check for errors
    $err = $client->getError();
    if ($err) {
        // Display the error
        echo '<h2>Error</h2><pre>' . $err . '</pre>';
    } else {
        // Display the result
        echo '<h2>Result</h2><pre>';
        print_r($result);
    echo '</pre>';
    }
}
// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($client->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($client->response, ENT_QUOTES) . '</pre>';
// Display the debug messages
echo '<h2>Debug</h2>';
echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
//echo "endpoint: ".$client->endpoint;
?>